<template>
    <div>
        <div class="WFtitle CLtitle flexbox spacebetween">
            <p class="leftBtn" @click="isShow = !isShow">{{isShow ? '隐藏' : '显示'}}</p>
            <p style="font-size: 16px;">两面长龙排行</p>
            <p></p>
        </div>
        <x-table v-show="isShow">
            <tr>
                <th>号码</th>
                <th>期数</th>
            </tr>
            <tr v-for="(item,index) in doubleData" :key="index">
                <td>{{item.title}}</td>
                <td><span class="blue bolds">{{item.num}}</span>期</td>
            </tr>
        </x-table>
    </div>
</template>

<script>
    import '../../../../assets/css/main.css'
    import {lotterytype} from '../../../../assets/js/lotterytype.js'
    import { XTable } from 'vux'
    export default {
        name: "LongDragon",
        props: {  //普通类型：String、Number、Boolean、Null    引用类型： Array、Object
            gameName: {  //当前游戏
                type: String,
                required: true
            },
            refreshClong: {  //是否刷新两面长龙
                type: Number,
                required: true
            },
        },
        components: {
            XTable
        },
        data(){
            return{
                doubleData: [],  //双面长龙data
                isShow: true,
            }
        },
        methods: {
            init(){
                // console.log(this.gameName);
                var _this = this;

                // if(window.localStorage.Authorizations){
                
                if(_this.gameName){
                    this.$httpGet('/api/game/longDragon/'+ _this.gameName).then(response => {
                        
                        if(response.status == 200){
                            _this.doubleData = response.data.double.win;
                        }

                    });
                }
                    
                // }
                
            },
        },
        mounted(){
            
        },
        watch: {
            
            gameName: function(now,old){
                this.init();
            },
            refreshClong: function(now,old){
                console.log('refreshClong',now);
                if(now != 0){
                    this.init();
                }
                
            },
        },
    }
</script>
